#pragma once

#include <map>
#include <vector>
#include <string>

using namespace std;


class CPreprocessor
{
private:

	string m_sProgram;
	string m_sMainFile;
	string m_sPath;

	map<string,bool> m_importedFiles;

	map<string,string> m_classes;

	vector<string> m_vClassesToBuild;
	map<string,vector<string> > m_partClasses;


	void ResetProgram();
	void BuildClasses();
	bool AddToProgramFile(const string &filepath);
	void ReadDataByLevelAndName(const int level,const string &classname,string &data);
public:
	CPreprocessor(const string &mainfile, const string& path);
	~CPreprocessor(void);

	vector<string>::iterator ClassesBegin() { return m_vClassesToBuild.begin();	}
	vector<string>::iterator ClassesEnd() { return m_vClassesToBuild.end();	}

	bool Exists(const string& classname);
	vector<string>& Get(const string& classNameInheritance);
	string& Process();
	string& GetProgram();
};
